package model.rotationSystem 
{
	import model.Board;
	import model.Shapes.TetrisShape;
	/**
	 * ...
	 * @author Yang Wang
	 */
	public class SuperRotationSystem implements IRotationSystem 
	{
		private var m_board:Board;
		
		public function SuperRotationSystem(board:Board) 
		{
			m_board = board;
		}
		
		/* INTERFACE model.rotationSystem.IRotationSystem */
		
		public function rotateLeft():void 
		{
			var shape:TetrisShape =  m_board.currentShape;
			var squares:Array = shape.getSquares(shape.getOrientationLeft());
			if (m_board.isValidShapePosition(m_board.shapePosition, squares)) {
				shape.rotateLeft();
			} else {
				if (m_board.isValidShapePosition(m_board.shapePosition, squares)) {
					m_board.moveShapeLeft();
				} 
				
			}
		}
		
		public function rotateRight():void 
		{
			
		}
		
		private function wallKick() : void {
			
		}
		
	}

}